
use "${data}/Utils/Siren_NAF_rev12_dads", clear
*destring siren, replace force
drop if mi(siren)
merge 1:1 siren using "${data}/Utils/Siren_NAF_rev12_bicrn", nogen keep(1 2 3 4 5) update
drop share
compress
destring siren, replace
save "${data}/Utils/Siren_NAF_rev12", replace

use share naf* if !mi(naf_rev1) &  !mi(naf_rev2) using "${data}/Utils/Siren_NAF_rev12_dads", clear
drop if mi(share)
drop if substr(naf_rev1,1,3) == "000" | substr(naf_rev2,1,3) == "000"
bys naf_rev1 (share): keep if _n == _N
save "${data}/Utils/NAF_rev12_impute", replace